package com.isorf.mapper;

import com.isorf.pojo.links;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface linkmapper {

    @Insert("insert into links values (#{id},#{link_name},#{link_url},#{link_image})")
    int addlink(links link);

    @Select("select* from links")
    List<links> pageList();
    @Delete("delete from links where id=#{id}")
    int deletelink(Integer id);

    @Delete({
            "<script>",
            "DELETE FROM links WHERE id IN",
            "<foreach collection='list' item='id' open='(' separator=',' close=')'>",
            "#{id}",
            "</foreach>",
            "</script>"
    })
    int batchDelete(List<Integer> brandid);

    @Update("UPDATE links SET link_name = #{link_name}, link_url = #{link_url}, link_image = #{link_image} WHERE id = #{id}")
    int updateLink(links link);

}
